﻿#include "pch.h"
#include "internalfunctions.h"
#include "SvgObjectHeaders.h"
#include <gdiplus.h>
using namespace Gdiplus;

int Get10ValueFrom16Value(char chValue, int index)
{
	switch (chValue)
	{
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	{
		int iValue = chValue - 48;
		return iValue * pow((double)16, index);
	}
	break;
	case 'a':
	case 'A':
	{
		return 10 * pow((double)16, index);
	}
	break;
	case 'b':
	case 'B':
	{
		return 11 * pow((double)16, index);
	}
	break;
	case 'c':
	case 'C':
	{
		return 12 * pow((double)16, index);
	}
	break;
	case 'd':
	case 'D':
	{
		return 13 * pow((double)16, index);
	}
	break;
	case 'e':
	case 'E':
	{
		return 14 * pow((double)16, index);
	}
	break;
	case 'f':
	case 'F':
	{
		return 15 * pow((double)16, index);
	}
	break;
	}
	return 0;
}

/////////////////
Color SVGColorAnyStringToColor(CString aSvgColorString)
{
	CString mSvgColor = aSvgColorString;
	mSvgColor.Trim();
	Gdiplus::Color mRetColor = 0;

	if (isSvgColorWellHex6String(mSvgColor)) {
		mSvgColor = SvgColorStringWellHex6ToRealHex8String(mSvgColor);
	};

	if (isSvgColorRealHex8String(mSvgColor)) {
		mRetColor = SvgColorRealHexStringToColor(mSvgColor);
	}
	else {
		mRetColor = SVGColorNaturalStringToColor(aSvgColorString);
	}
	return mRetColor;
}



//////#123456
bool isSvgColorWellHex6String(CString aSvgColor) {
	bool mb = false;
	int mLen = aSvgColor.GetLength();
	if (aSvgColor.GetLength() == 7) {
		if (aSvgColor.GetAt(0) == _T('#')) {
			mb = true;
		}
	}
	return mb;
}

//////0x12345678
bool isSvgColorRealHex8String(CString aSvgColor) {
	bool mb = false;
	int mLen = aSvgColor.GetLength();
	if (aSvgColor.GetLength() == 10) {
		if ((aSvgColor.GetAt(0) == _T('0'))&&((aSvgColor.GetAt(1) == _T('x'))||(aSvgColor.GetAt(1) == _T('X')))) {
			mb = true;
		}
	}
	return mb;
}


/////////////////
////#123456 -> 0xFF123456
CString SvgColorStringWellHex6ToRealHex8String(CString aSvgColor) {
	CString mSvgColor = aSvgColor;
	mSvgColor.Trim();
	CString aRetStr = mSvgColor;

	////
	if ((mSvgColor.GetAt(0) == _T('#'))) {
		int mLen = mSvgColor.GetLength();
		if (mLen < 7) { ////#12: to #FFFF12
			aRetStr.Empty();
			aRetStr.AppendChar(_T('0'));
			aRetStr.AppendChar(_T('x'));
			int mLeftZero = 7 - mLen;
			for (int i = 0; i < mLeftZero; i++) {
				aRetStr.AppendChar(_T('F'));  ////? aRetStr.AppendChar('0')
			}
			for (int i = 1; i < mLen; i++) {
				aRetStr.AppendChar(mSvgColor.GetAt(i));
			}
		} else if (mLen == 7) { ////#123456
			aRetStr.Empty();
			aRetStr.AppendChar(_T('0'));
			aRetStr.AppendChar(_T('x'));
			aRetStr.AppendChar(_T('F'));
			aRetStr.AppendChar(_T('F'));
			aRetStr.AppendChar(mSvgColor.GetAt(1));
			aRetStr.AppendChar(mSvgColor.GetAt(2));
			aRetStr.AppendChar(mSvgColor.GetAt(3));
			aRetStr.AppendChar(mSvgColor.GetAt(4));
			aRetStr.AppendChar(mSvgColor.GetAt(5));
			aRetStr.AppendChar(mSvgColor.GetAt(6));

			//aRetStr.AppendChar(mSvgColor.GetAt(5));
			//aRetStr.AppendChar(mSvgColor.GetAt(6));
			//aRetStr.AppendChar(mSvgColor.GetAt(3));
			//aRetStr.AppendChar(mSvgColor.GetAt(4));
			//aRetStr.AppendChar(mSvgColor.GetAt(1));
			//aRetStr.AppendChar(mSvgColor.GetAt(2));
		}
		else if (mLen >= 9) { ////#12345678
			aRetStr.Empty();
			aRetStr.AppendChar(_T('0'));
			aRetStr.AppendChar(_T('x'));
			aRetStr.AppendChar(mSvgColor.GetAt(1));
			aRetStr.AppendChar(mSvgColor.GetAt(2));
			aRetStr.AppendChar(mSvgColor.GetAt(3));
			aRetStr.AppendChar(mSvgColor.GetAt(4));
			aRetStr.AppendChar(mSvgColor.GetAt(5));
			aRetStr.AppendChar(mSvgColor.GetAt(6));
			aRetStr.AppendChar(mSvgColor.GetAt(7));
			aRetStr.AppendChar(mSvgColor.GetAt(8));
		}
	}

	return aRetStr;
}


////
BYTE CStringByteToBYTE(CString aCStringByteStr) {
	std::string str;
	str = CW2A(aCStringByteStr.GetString());
	const char* pstr=str.c_str();
	unsigned int iNum=0;
	iNum = strtol(pstr, NULL, 16);
	return (BYTE)iNum;
}
/////////////////
////0x12345678 -> Color
Color SvgColorRealHexStringToColor(CString aSvgColor) {
	CString mSvgColor = aSvgColor;
	mSvgColor.Trim();
	mSvgColor.Replace(_T("0x"), _T(""));
	mSvgColor.Replace(_T("0X"), _T(""));
	CString astr, rstr, gstr, bstr;
	BYTE a, r, g, b;
	unsigned int iNum;
	astr.Empty();
	astr.AppendChar(mSvgColor.GetAt(0));
	astr.AppendChar(mSvgColor.GetAt(1));
	a = CStringByteToBYTE(astr);
	rstr.Empty();
	rstr.AppendChar(mSvgColor.GetAt(2));
	rstr.AppendChar(mSvgColor.GetAt(3));
	r = CStringByteToBYTE(rstr);
	gstr.Empty();
	gstr.AppendChar(mSvgColor.GetAt(4));
	gstr.AppendChar(mSvgColor.GetAt(5));
	g = CStringByteToBYTE(gstr);
	bstr.Empty();
	bstr.AppendChar(mSvgColor.GetAt(6));
	bstr.AppendChar(mSvgColor.GetAt(7));
	b = CStringByteToBYTE(bstr);

	Gdiplus::Color mRetColor = Gdiplus::Color(a,r,g,b);
	return mRetColor;
}



/////////////////
///aSvgColorString:none, Blue, ...
////Gdiplus::Color
Color SVGColorNaturalStringToColor(CString aSvgColorString)
{
	Gdiplus::Color mRetColor = 0;

	if (aSvgColorString.CompareNoCase(_T("AliceBlue")) == 0)
	{
		mRetColor = Color::AliceBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("AntiqueWhite")) == 0)
	{
		mRetColor = Color::AntiqueWhite;
	}
	else if (aSvgColorString.CompareNoCase(_T("Aqua")) == 0)
	{
		mRetColor = Color::Aqua;
	}
	else if (aSvgColorString.CompareNoCase(_T("Aquamarine")) == 0)
	{
		mRetColor = Color::Aquamarine;
	}
	else if (aSvgColorString.CompareNoCase(_T("Azure")) == 0)
	{
		mRetColor = Color::Azure;
	}
	else if (aSvgColorString.CompareNoCase(_T("Beige")) == 0)
	{
		mRetColor = Color::Beige;
	}
	else if (aSvgColorString.CompareNoCase(_T("Bisque")) == 0)
	{
		mRetColor = Color::Bisque;
	}
	else if (aSvgColorString.CompareNoCase(_T("Black")) == 0)
	{
		mRetColor = Color::Black;
	}
	else if (aSvgColorString.CompareNoCase(_T("BlanchedAlmond")) == 0)
	{
		mRetColor = Color::BlanchedAlmond;
	}
	else if (aSvgColorString.CompareNoCase(_T("Blue")) == 0)
	{
		mRetColor = Color::Blue;
	}
	else if (aSvgColorString.CompareNoCase(_T("BlueViolet")) == 0)
	{
		mRetColor = Color::BlueViolet;
	}
	else if (aSvgColorString.CompareNoCase(_T("Brown")) == 0)
	{
		mRetColor = Color::Brown;
	}
	else if (aSvgColorString.CompareNoCase(_T("BurlyWood")) == 0)
	{
		mRetColor = Color::BurlyWood;
	}

	else if (aSvgColorString.CompareNoCase(_T("CadetBlue")) == 0)
	{
		mRetColor = Color::CadetBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("Chartreuse")) == 0)
	{
		mRetColor = Color::Chartreuse;
	}
	else if (aSvgColorString.CompareNoCase(_T("Chocolate")) == 0)
	{
		mRetColor = Color::Chocolate;
	}
	else if (aSvgColorString.CompareNoCase(_T("Coral")) == 0)
	{
		mRetColor = Color::Coral;
	}
	else if (aSvgColorString.CompareNoCase(_T("CornflowerBlue")) == 0)
	{
		mRetColor = Color::CornflowerBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("Cornsilk")) == 0)
	{
		mRetColor = Color::Cornsilk;
	}
	else if (aSvgColorString.CompareNoCase(_T("Crimson")) == 0)
	{
		mRetColor = Color::Crimson;
	}
	else if (aSvgColorString.CompareNoCase(_T("Cyan")) == 0)
	{
		mRetColor = Color::Cyan;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkBlue")) == 0)
	{
		mRetColor = Color::DarkBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkCyan")) == 0)
	{
		mRetColor = Color::DarkCyan;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkGoldenrod")) == 0)
	{
		mRetColor = Color::DarkGoldenrod;
	}
	//
	else if (aSvgColorString.CompareNoCase(_T("DarkGray")) == 0)
	{
		mRetColor = Color::DarkGray;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkGreen")) == 0)
	{
		mRetColor = Color::DarkGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkKhaki")) == 0)
	{
		mRetColor = Color::DarkKhaki;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkMagenta")) == 0)
	{
		mRetColor = Color::DarkMagenta;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkOliveGreen")) == 0)
	{
		mRetColor = Color::DarkOliveGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkOrange")) == 0)
	{
		mRetColor = Color::DarkOrange;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkOrchid")) == 0)
	{
		mRetColor = Color::DarkOrchid;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkRed")) == 0)
	{
		mRetColor = Color::DarkRed;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkSalmon")) == 0)
	{
		mRetColor = Color::DarkSalmon;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkSeaGreen")) == 0)
	{
		mRetColor = Color::DarkSeaGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkSlateBlue")) == 0)
	{
		mRetColor = Color::DarkSlateBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkSlateGray")) == 0)
	{
		mRetColor = Color::DarkSlateGray;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkTurquoise")) == 0)
	{
		mRetColor = Color::DarkTurquoise;
	}
	else if (aSvgColorString.CompareNoCase(_T("DarkViolet")) == 0)
	{
		mRetColor = Color::DarkViolet;
	}
	else if (aSvgColorString.CompareNoCase(_T("DeepPink")) == 0)
	{
		mRetColor = Color::DeepPink;
	}
	else if (aSvgColorString.CompareNoCase(_T("DeepSkyBlue")) == 0)
	{
		mRetColor = Color::DeepSkyBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("DimGray")) == 0)
	{
		mRetColor = Color::DimGray;
	}
	else if (aSvgColorString.CompareNoCase(_T("DodgerBlue")) == 0)
	{
		mRetColor = Color::DodgerBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("Firebrick")) == 0)
	{
		mRetColor = Color::Firebrick;
	}
	else if (aSvgColorString.CompareNoCase(_T("FloralWhite")) == 0)
	{
		mRetColor = Color::FloralWhite;
	}
	else if (aSvgColorString.CompareNoCase(_T("ForestGreen")) == 0)
	{
		mRetColor = Color::ForestGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("Fuchsia")) == 0)
	{
		mRetColor = Color::Fuchsia;
	}

	else if (aSvgColorString.CompareNoCase(_T("Gainsboro")) == 0)
	{
		mRetColor = Color::Gainsboro;
	}
	else if (aSvgColorString.CompareNoCase(_T("GhostWhite")) == 0)
	{
		mRetColor = Color::GhostWhite;
	}
	else if (aSvgColorString.CompareNoCase(_T("Gold")) == 0)
	{
		mRetColor = Color::Gold;
	}
	else if (aSvgColorString.CompareNoCase(_T("Goldenrod")) == 0)
	{
		mRetColor = Color::Goldenrod;
	}
	else if (aSvgColorString.CompareNoCase(_T("Gray")) == 0)
	{
		mRetColor = Color::Gray;
	}
	else if (aSvgColorString.CompareNoCase(_T("Green")) == 0)
	{
		mRetColor = Color::Green;
	}
	else if (aSvgColorString.CompareNoCase(_T("GreenYellow")) == 0)
	{
		mRetColor = Color::GreenYellow;
	}
	else if (aSvgColorString.CompareNoCase(_T("Honeydew")) == 0)
	{
		mRetColor = Color::Honeydew;
	}
	else if (aSvgColorString.CompareNoCase(_T("HotPink")) == 0)
	{
		mRetColor = Color::HotPink;
	}
	else if (aSvgColorString.CompareNoCase(_T("IndianRed")) == 0)
	{
		mRetColor = Color::IndianRed;
	}
	else if (aSvgColorString.CompareNoCase(_T("Indigo")) == 0)
	{
		mRetColor = Color::Indigo;
	}
	else if (aSvgColorString.CompareNoCase(_T("Ivory")) == 0)
	{
		mRetColor = Color::Ivory;
	}
	else if (aSvgColorString.CompareNoCase(_T("Khaki")) == 0)
	{
		mRetColor = Color::Khaki;
	}
	else if (aSvgColorString.CompareNoCase(_T("Lavender")) == 0)
	{
		mRetColor = Color::Lavender;
	}
	else if (aSvgColorString.CompareNoCase(_T("LavenderBlush")) == 0)
	{
		mRetColor = Color::LavenderBlush;
	}
	else if (aSvgColorString.CompareNoCase(_T("LawnGreen")) == 0)
	{
		mRetColor = Color::LawnGreen;
	}
	//
	else if (aSvgColorString.CompareNoCase(_T("LemonChiffon")) == 0)
	{
		mRetColor = Color::LemonChiffon;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightBlue")) == 0)
	{
		mRetColor = Color::LightBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightCoral")) == 0)
	{
		mRetColor = Color::LightCoral;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightCyan")) == 0)
	{
		mRetColor = Color::LightCyan;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightGoldenrodYellow")) == 0)
	{
		mRetColor = Color::LightGoldenrodYellow;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightGray")) == 0)
	{
		mRetColor = Color::LightGray;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightGreen")) == 0)
	{
		mRetColor = Color::LightGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightPink")) == 0)
	{
		mRetColor = Color::LightPink;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightSalmon")) == 0)
	{
		mRetColor = Color::LightSalmon;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightSeaGreen")) == 0)
	{
		mRetColor = Color::LightSeaGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightSkyBlue")) == 0)
	{
		mRetColor = Color::LightSkyBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightSlateGray")) == 0)
	{
		mRetColor = Color::LightSlateGray;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightSteelBlue")) == 0)
	{
		mRetColor = Color::LightSteelBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("LightYellow")) == 0)
	{
		mRetColor = Color::LightYellow;
	}
	else if (aSvgColorString.CompareNoCase(_T("Lime")) == 0)
	{
		mRetColor = Color::Lime;
	}
	else if (aSvgColorString.CompareNoCase(_T("LimeGreen")) == 0)
	{
		mRetColor = Color::LimeGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("Linen")) == 0)
	{
		mRetColor = Color::Linen;
	}
	else if (aSvgColorString.CompareNoCase(_T("Magenta")) == 0)
	{
		mRetColor = Color::Magenta;
	}
	else if (aSvgColorString.CompareNoCase(_T("Maroon")) == 0)
	{
		mRetColor = Color::Maroon;
	}
	else if (aSvgColorString.CompareNoCase(_T("MediumAquamarine")) == 0)
	{
		mRetColor = Color::MediumAquamarine;
	}
	else if (aSvgColorString.CompareNoCase(_T("MediumBlue")) == 0)
	{
		mRetColor = Color::MediumBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("MediumOrchid")) == 0)
	{
		mRetColor = Color::MediumOrchid;
	}
	else if (aSvgColorString.CompareNoCase(_T("MediumPurple")) == 0)
	{
		mRetColor = Color::MediumPurple;
	}
	//
	else if (aSvgColorString.CompareNoCase(_T("MediumSeaGreen")) == 0)
	{
		mRetColor = Color::MediumSeaGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("MediumSlateBlue")) == 0)
	{
		mRetColor = Color::MediumSlateBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("MediumSpringGreen")) == 0)
	{
		mRetColor = Color::MediumSpringGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("MediumTurquoise")) == 0)
	{
		mRetColor = Color::MediumTurquoise;
	}
	else if (aSvgColorString.CompareNoCase(_T("MediumVioletRed")) == 0)
	{
		mRetColor = Color::MediumVioletRed;
	}
	else if (aSvgColorString.CompareNoCase(_T("MidnightBlue")) == 0)
	{
		mRetColor = Color::MidnightBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("MintCream")) == 0)
	{
		mRetColor = Color::MintCream;
	}
	else if (aSvgColorString.CompareNoCase(_T("MistyRose")) == 0)
	{
		mRetColor = Color::MistyRose;
	}
	else if (aSvgColorString.CompareNoCase(_T("Moccasin")) == 0)
	{
		mRetColor = Color::Moccasin;
	}
	else if (aSvgColorString.CompareNoCase(_T("NavajoWhite")) == 0)
	{
		mRetColor = Color::NavajoWhite;
	}
	else if (aSvgColorString.CompareNoCase(_T("Navy")) == 0)
	{
		mRetColor = Color::Navy;
	}
	//un
	else if (aSvgColorString.CompareNoCase(_T("OldLace")) == 0)
	{
		mRetColor = Color::OldLace;
	}
	else if (aSvgColorString.CompareNoCase(_T("Olive")) == 0)
	{
		mRetColor = Color::Olive;
	}
	else if (aSvgColorString.CompareNoCase(_T("OliveDrab")) == 0)
	{
		mRetColor = Color::OliveDrab;
	}
	else if (aSvgColorString.CompareNoCase(_T("Orange")) == 0)
	{
		mRetColor = Color::Orange;
	}
	else if (aSvgColorString.CompareNoCase(_T("OrangeRed")) == 0)
	{
		mRetColor = Color::OrangeRed;
	}
	else if (aSvgColorString.CompareNoCase(_T("Orchid")) == 0)
	{
		mRetColor = Color::Orchid;
	}
	else if (aSvgColorString.CompareNoCase(_T("PaleGoldenrod")) == 0)
	{
		mRetColor = Color::PaleGoldenrod;
	}
	else if (aSvgColorString.CompareNoCase(_T("PaleGreen")) == 0)
	{
		mRetColor = Color::PaleGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("PaleTurquoise")) == 0)
	{
		mRetColor = Color::PaleTurquoise;
	}
	else if (aSvgColorString.CompareNoCase(_T("PaleVioletRed")) == 0)
	{
		mRetColor = Color::PaleVioletRed;
	}
	else if (aSvgColorString.CompareNoCase(_T("PapayaWhip")) == 0)
	{
		mRetColor = Color::PapayaWhip;
	}
	else if (aSvgColorString.CompareNoCase(_T("PeachPuff")) == 0)
	{
		mRetColor = Color::PeachPuff;
	}
	else if (aSvgColorString.CompareNoCase(_T("Peru")) == 0)
	{
		mRetColor = Color::Peru;
	}
	else if (aSvgColorString.CompareNoCase(_T("Pink")) == 0)
	{
		mRetColor = Color::Pink;
	}
	else if (aSvgColorString.CompareNoCase(_T("Plum")) == 0)
	{
		mRetColor = Color::Plum;
	}
	//
	else if (aSvgColorString.CompareNoCase(_T("PowderBlue")) == 0)
	{
		mRetColor = Color::PowderBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("Purple")) == 0)
	{
		mRetColor = Color::Purple;
	}
	else if (aSvgColorString.CompareNoCase(_T("Red")) == 0)
	{
		mRetColor = Color::Red;
	}
	else if (aSvgColorString.CompareNoCase(_T("RosyBrown")) == 0)
	{
		mRetColor = Color::RosyBrown;
	}
	else if (aSvgColorString.CompareNoCase(_T("RoyalBlue")) == 0)
	{
		mRetColor = Color::RoyalBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("SaddleBrown")) == 0)
	{
		mRetColor = Color::SaddleBrown;
	}
	else if (aSvgColorString.CompareNoCase(_T("Salmon")) == 0)
	{
		mRetColor = Color::Salmon;
	}
	else if (aSvgColorString.CompareNoCase(_T("SandyBrown")) == 0)
	{
		mRetColor = Color::SandyBrown;
	}
	else if (aSvgColorString.CompareNoCase(_T("SeaGreen")) == 0)
	{
		mRetColor = Color::SeaGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("SeaShell")) == 0)
	{
		mRetColor = Color::SeaShell;
	}
	else if (aSvgColorString.CompareNoCase(_T("Sienna")) == 0)
	{
		mRetColor = Color::Sienna;
	}

	if (aSvgColorString.CompareNoCase(_T("Silver")) == 0)
	{
		mRetColor = Color::Silver;
	}
	else if (aSvgColorString.CompareNoCase(_T("SkyBlue")) == 0)
	{
		mRetColor = Color::SkyBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("SlateBlue")) == 0)
	{
		mRetColor = Color::SlateBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("SlateGray")) == 0)
	{
		mRetColor = Color::SlateGray;
	}
	else if (aSvgColorString.CompareNoCase(_T("Snow")) == 0)
	{
		mRetColor = Color::Snow;
	}
	else if (aSvgColorString.CompareNoCase(_T("SpringGreen")) == 0)
	{
		mRetColor = Color::SpringGreen;
	}
	else if (aSvgColorString.CompareNoCase(_T("SteelBlue")) == 0)
	{
		mRetColor = Color::SteelBlue;
	}
	else if (aSvgColorString.CompareNoCase(_T("Tan")) == 0)
	{
		mRetColor = Color::Tan;
	}
	else if (aSvgColorString.CompareNoCase(_T("Teal")) == 0)
	{
		mRetColor = Color::Teal;
	}
	else if (aSvgColorString.CompareNoCase(_T("Thistle")) == 0)
	{
		mRetColor = Color::Thistle;
	}
	else if (aSvgColorString.CompareNoCase(_T("Tomato")) == 0)
	{
		mRetColor = Color::Tomato;
	}
	else if (aSvgColorString.CompareNoCase(_T("Transparent")) == 0)
	{
		mRetColor = Color::Transparent;
	}
	else if (aSvgColorString.CompareNoCase(_T("Turquoise")) == 0)
	{
		mRetColor = Color::Turquoise;
	}
	else if (aSvgColorString.CompareNoCase(_T("Violet")) == 0)
	{
		mRetColor = Color::Violet;
	}
	else if (aSvgColorString.CompareNoCase(_T("Wheat")) == 0)
	{
		mRetColor = Color::Wheat;
	}
	else if (aSvgColorString.CompareNoCase(_T("White")) == 0)
	{
		mRetColor = Color::White;
	}
	else if (aSvgColorString.CompareNoCase(_T("WhiteSmoke")) == 0)
	{
		mRetColor = Color::WhiteSmoke;
	}
	else if (aSvgColorString.CompareNoCase(_T("Yellow")) == 0)
	{
		mRetColor = Color::Yellow;
	}
	else if (aSvgColorString.CompareNoCase(_T("YellowGreen")) == 0)
	{
		mRetColor = Color::YellowGreen;
	}
	else
	{
		//无颜色
		mRetColor = 0;
	}

	return mRetColor;
}
